<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, user-scalable=no">
  <meta name="generator" content="made with love by dartdoc 7.0.0-dev">
  <meta name="description" content="uuid API docs, for the Dart programming language.">
  <title>uuid - Dart API docs</title>


  
  <link rel="preconnect" href="https://fonts.gstatic.com">
  <link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,300;0,400;0,500;0,700;1,400&display=swap" rel="stylesheet">
  <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,0,0" rel="stylesheet">
  
  <link rel="stylesheet" href="static-assets/github.css?v1">
  <link rel="stylesheet" href="static-assets/styles.css?v1">
  <link rel="icon" href="static-assets/favicon.png?v1">

  
</head>


<body data-base-href="" data-using-base-href="false" class="light-theme">

<div id="overlay-under-drawer"></div>

<header id="title">
  <span id="sidenav-left-toggle" class="material-symbols-outlined" role="button" tabindex="0">menu</span>
  <ol class="breadcrumbs gt-separated dark hidden-xs">
    <li class="self-crumb">uuid package</li>
  </ol>
  <div class="self-name">uuid</div>
  <form class="search navbar-right" role="search">
    <input type="text" id="search-box" autocomplete="off" disabled class="form-control typeahead" placeholder="Loading search...">
  </form>
  <div class="toggle" id="theme-button">
    <label for="theme">
      <input type="checkbox" id="theme" value="light-theme">
      <span id="dark-theme-button" class="material-symbols-outlined">
        brightness_4
      </span>
      <span id="light-theme-button" class="material-symbols-outlined">
        brightness_5
      </span>
    </label>
  </div>
</header>
<main>

  <div id="dartdoc-main-content" class="main-content">
      
<section class="desc markdown">
  <h1 id="uuid">uuid</h1>
<p><strong>Version 4.0.x is a complete redesign of the underlying setup, but tries to be API compatible or similar to 3.x.</strong></p>
<p><strong>UuidValue is still Experimental and the API for it is in flux, please pay attention to changelogs and versions.</strong></p>
<p><a href="https://github.com/Daegalus/dart-uuid/actions"><img src="https://github.com/Daegalus/dart-uuid/workflows/Dart/badge.svg?branch=main&amp;event=push" alt="Build Status"></a></p>
<p>Simple, fast generation of <a href="https://www.ietf.org/rfc/rfc4122.txt">RFC4122</a> UUIDs.</p>
<p>Features:</p>
<ul>
<li>Generate RFC4122 version 1, version 4, or version 5 UUIDs</li>
<li>Supports draft version 6, version 7, and version 8</li>
<li>Runs in web, server, and flutter</li>
<li>Cryptographically strong random number generation on all platforms
<ul>
<li><strong>Defaults to non-crypto generator, see UuidUtil for cryptoRNG</strong></li>
</ul>
</li>
<li><a href="https://daegalus.github.io/dart-uuid/index.html">Documentation</a></li>
</ul>
<h2 id="getting-started">Getting Started</h2>
<h3 id="instructions">Instructions</h3>
<ol>
<li>Open a command line and cd to your projects root folder</li>
<li>In your pubspec, add an entry for dart-uuid to your dependencies (example below)</li>
<li>pub install</li>
<li>If you wish to run tests, go into packages/dart-uuid/ and run 'dart test/uuid_test.dart'</li>
</ol>
<h3 id="pubspec">Pubspec</h3>
<pre class="language-yaml"><code class="language-yaml">dependencies:
  uuid: ^4.0.0
</code></pre>
<pre class="language-dart"><code class="language-dart">import 'package:uuid/uuid.dart';

var uuid = Uuid();
</code></pre>
<p>Then create some ids ...</p>
<pre class="language-dart"><code class="language-dart">// Generate a v1 (time-based) id
uuid.v1(); // -&gt; '6c84fb90-12c4-11e1-840d-7b25c5ee775a'

// Generate a v4 (random) id
uuid.v4(); // -&gt; '110ec58a-a0f2-4ac4-8393-c866d813b8d1'

// Generate a v5 (namespace-name-sha1-based) id
uuid.v5(Uuid.NAMESPACE_URL, 'www.google.com'); // -&gt; 'c74a196f-f19d-5ea9-bffd-a2742432fc9c'
</code></pre>
<h2 id="documentation">Documentation</h2>
<p>For documentation, please visit the <a href="https://daegalus.github.io/dart-uuid/index.html">Documentation</a> page. Examples are included for most functions and classes.</p>
<p>For more complex examples and other usages, please look at the <a href="test/uuid_test.dart">tests</a>.</p>
<h2 id="release-notes">Release notes</h2>
<p>See <a href="CHANGELOG.md">CHANGELOG</a></p>
</section>


      <section class="summary">
          <h2>Libraries</h2>
        <dl>
          <dt id="data">
  <span class="name"><a href="data/data-library.html">data</a></span> 

</dt>
<dd>
</dd>

          <dt id="enums">
  <span class="name"><a href="enums/enums-library.html">enums</a></span> 

</dt>
<dd>
</dd>

          <dt id="parsing">
  <span class="name"><a href="parsing/parsing-library.html">parsing</a></span> 

</dt>
<dd>
</dd>

          <dt id="rng">
  <span class="name"><a href="rng/rng-library.html">rng</a></span> 

</dt>
<dd>
</dd>

          <dt id="uuid">
  <span class="name"><a href="uuid/uuid-library.html">uuid</a></span> 

</dt>
<dd>Generates UUID v1, v4, v5, v6, v7, v8 following RFC4122 standard.
</dd>

          <dt id="uuid_value">
  <span class="name"><a href="uuid_value/uuid_value-library.html">uuid_value</a></span> 

</dt>
<dd>
</dd>

          <dt id="v1">
  <span class="name"><a href="v1/v1-library.html">v1</a></span> 

</dt>
<dd>
</dd>

          <dt id="v4">
  <span class="name"><a href="v4/v4-library.html">v4</a></span> 

</dt>
<dd>
</dd>

          <dt id="v5">
  <span class="name"><a href="v5/v5-library.html">v5</a></span> 

</dt>
<dd>
</dd>

          <dt id="v6">
  <span class="name"><a href="v6/v6-library.html">v6</a></span> 

</dt>
<dd>
</dd>

          <dt id="v7">
  <span class="name"><a href="v7/v7-library.html">v7</a></span> 

</dt>
<dd>
</dd>

          <dt id="v8">
  <span class="name"><a href="v8/v8-library.html">v8</a></span> 

</dt>
<dd>
</dd>

          <dt id="validation">
  <span class="name"><a href="validation/validation-library.html">validation</a></span> 

</dt>
<dd>
</dd>

        </dl>
      </section>

  </div> <!-- /.main-content -->

  <div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left">
    <!-- The search input and breadcrumbs below are only responsively visible at low resolutions. -->
<header id="header-search-sidebar" class="hidden-l">
  <form class="search-sidebar" role="search">
    <input type="text" id="search-sidebar" autocomplete="off" disabled class="form-control typeahead" placeholder="Loading search...">
  </form>
</header>

<ol class="breadcrumbs gt-separated dark hidden-l" id="sidebar-nav">
    <li class="self-crumb">uuid package</li>
</ol>


    <h5 class="hidden-xs"><span class="package-name">uuid</span> <span class="package-kind">package</span></h5>
    <ol>
      <li class="section-title">Libraries</li>
      <li><a href="data/data-library.html">data</a></li>
      <li><a href="enums/enums-library.html">enums</a></li>
      <li><a href="parsing/parsing-library.html">parsing</a></li>
      <li><a href="rng/rng-library.html">rng</a></li>
      <li><a href="uuid/uuid-library.html">uuid</a></li>
      <li><a href="uuid_value/uuid_value-library.html">uuid_value</a></li>
      <li><a href="v1/v1-library.html">v1</a></li>
      <li><a href="v4/v4-library.html">v4</a></li>
      <li><a href="v5/v5-library.html">v5</a></li>
      <li><a href="v6/v6-library.html">v6</a></li>
      <li><a href="v7/v7-library.html">v7</a></li>
      <li><a href="v8/v8-library.html">v8</a></li>
      <li><a href="validation/validation-library.html">validation</a></li>
</ol>

  </div>

  <div id="dartdoc-sidebar-right" class="sidebar sidebar-offcanvas-right">
  </div>

</main>

<footer>
  <span class="no-break">
    uuid
      4.2.1
  </span>

  
</footer>



<script src="static-assets/highlight.pack.js?v1"></script>
<script src="static-assets/docs.dart.js"></script>



</body>

</html>

